<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var myObj = { name:'我是前端bug开发攻城狮' } 
    function myFunc(name,age){ 
      console.log('argument.name===',name) 
      console.log('this.name：age==',this.name,':',age) 
    }
    Function.prototype.myApply = function(context) {
      context = context || window
      context.fn = this
      var args = [...arguments][1]
      if(!Array.isArray(args)) throw new Error( '请传第二个参数为数组' )
      var result = context.fn(...args) 
      delete context.fn; 
      return result 
    }
    myFunc.myApply(myObj, ['路人甲', 100])
  </script>
</body>
</html>